<html>
<head><meta charset="utf-8"><title>Supporting AT&amp;T syntax on x86 · project-inline-asm · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/index.html">project-inline-asm</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Supporting.20AT.26T.20syntax.20on.20x86.html">Supporting AT&amp;T syntax on x86</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="189933012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Supporting%20AT%26T%20syntax%20on%20x86/near/189933012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Supporting.20AT.26T.20syntax.20on.20x86.html#189933012">(Mar 06 2020 at 20:53)</a>:</h4>
<p><span class="user-mention" data-user-id="143274">@Amanieu</span> I remembered one other reason I'd really like optional support for AT&amp;T syntax on x86: with such support available, it wouldn't be <em>that</em> hard to automatically translate <code>llvm_asm!</code> to the new <code>asm!</code>.</p>



<a name="189933166"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Supporting%20AT%26T%20syntax%20on%20x86/near/189933166" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Supporting.20AT.26T.20syntax.20on.20x86.html#189933166">(Mar 06 2020 at 20:54)</a>:</h4>
<p>Having an <code>asm_att!</code> available or similar (or alternatively an <code>asm_intel!</code> for Intel syntax) would make it relatively easy to port. (And, for that matter, easier to port C code as well.)</p>



<a name="189933295"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Supporting%20AT%26T%20syntax%20on%20x86/near/189933295" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Supporting.20AT.26T.20syntax.20on.20x86.html#189933295">(Mar 06 2020 at 20:56)</a>:</h4>
<p>(I'm also increasingly debating if the default syntax on x86 should be AT&amp;T for consistency with other targets and then we can have an <code>asm_intel!</code>, or if the default syntax on x86 should be Intel and we can have an <code>asm_att!</code>.)</p>



<a name="189933359"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Supporting%20AT%26T%20syntax%20on%20x86/near/189933359" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Supporting.20AT.26T.20syntax.20on.20x86.html#189933359">(Mar 06 2020 at 20:57)</a>:</h4>
<p>Would it be <em>excessively</em> painful to plumb through an option for intelsyntax?</p>



<a name="189938970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Supporting%20AT%26T%20syntax%20on%20x86/near/189938970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Supporting.20AT.26T.20syntax.20on.20x86.html#189938970">(Mar 06 2020 at 22:02)</a>:</h4>
<p><span class="user-mention" data-user-id="239881">@Josh Triplett</span> I've actually addressed that in the RFC: you can implement AT&amp;T syntax on top <code>asm!</code> by using <code>.att_syntax</code> and adding <code>%</code> before register template placeholders.</p>



<a name="189939824"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Supporting%20AT%26T%20syntax%20on%20x86/near/189939824" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Supporting.20AT.26T.20syntax.20on.20x86.html#189939824">(Mar 06 2020 at 22:13)</a>:</h4>
<p><code>.intel_syntax noprefix</code> still allows prefixes. Would you consider just unconditionally using the prefixes in substitution?</p>



<a name="189940676"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Supporting%20AT%26T%20syntax%20on%20x86/near/189940676" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Supporting.20AT.26T.20syntax.20on.20x86.html#189940676">(Mar 06 2020 at 22:23)</a>:</h4>
<p>No, <code>.intel_syntax noprefix</code> does not actually allow prefixes. I tested this.</p>



<a name="189955758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Supporting%20AT%26T%20syntax%20on%20x86/near/189955758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Supporting.20AT.26T.20syntax.20on.20x86.html#189955758">(Mar 07 2020 at 04:08)</a>:</h4>
<p>I've written code relying on that in assembly. Perhaps LLVM's assembler just doesn't support it?</p>



<a name="189984487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Supporting%20AT%26T%20syntax%20on%20x86/near/189984487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Supporting.20AT.26T.20syntax.20on.20x86.html#189984487">(Mar 07 2020 at 20:17)</a>:</h4>
<p><a href="https://godbolt.org/z/DML3HV" target="_blank" title="https://godbolt.org/z/DML3HV">https://godbolt.org/z/DML3HV</a></p>



<a name="189984491"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216763-project-inline-asm/topic/Supporting%20AT%26T%20syntax%20on%20x86/near/189984491" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/216763-project-inline-asm/topic/Supporting.20AT.26T.20syntax.20on.20x86.html#189984491">(Mar 07 2020 at 20:17)</a>:</h4>
<p>Maybe you only used <code>.intel_syntax</code> instead of <code>.intel_syntax noprefix</code></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>